package admin

// sql 操作符枚举
type WhereOperator int

const (
	WhereEqual WhereOperator = iota
	WhereLike
	WhereIn
	WhereBetween
	WhereGreaterThan
	WhereLessThan
	WhereGreaterThanOrEqual
	WhereLessThanOrEqual
)

func (w WhereOperator) String() string {
	switch w {
	case WhereEqual:
		return "="
	case WhereLike:
		return "LIKE"
	case WhereIn:
		return "IN"
	case WhereBetween:
		return "BETWEEN"
	case WhereGreaterThan:
		return ">"
	case WhereGreaterThanOrEqual:
		return ">="
	case WhereLessThan:
		return "<"
	case WhereLessThanOrEqual:
		return "<="
	default:
		return "="
	}
}

type ValueType int

const (
	ValueTypeString ValueType = iota
	ValueTypeInt
	ValueTypeFloat
	ValueTypeBool
	ValueTypeDate
)

func (v ValueType) String() string {
	switch v {
	case ValueTypeString:
		return "string"
	case ValueTypeInt:
		return "int"
	case ValueTypeFloat:
		return "float"
	case ValueTypeBool:
		return "bool"
	case ValueTypeDate:
		return "date"
	default:
		return "string"
	}
}
